package com.example.yimai.utils;

import org.jetbrains.annotations.NotNull;

import java.util.Map;

public class ParamUtil {

    public static String parseParams(Map<String,Object> params, String attribute){
        if (params.get(attribute) == null || params.get(attribute).equals(""))return null;
        else return params.get(attribute).toString();
    }

    public static Integer parseParamsInt(Map<String,Object> params, String attribute){
        if (params.get(attribute) == null || params.get(attribute).equals(""))return null;
        else return Integer.parseInt(params.get(attribute).toString());
    }

    public static Float parseParamsFloat(Map<String,Object> params, String attribute){
        if (params.get(attribute) == null || params.get(attribute).equals(""))return null;
        else return Float.parseFloat(params.get(attribute).toString());
    }

}
